package com.test.demo.io.bio;

import java.io.IOException;
import java.net.Socket;

public class BIOSocketClient {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("localhost",9000);
        System.out.println("客户端启动了");
        socket.getOutputStream().write("HelloServer".getBytes());
        socket.getOutputStream().flush();
        byte[] bytes = new byte[1024];
        socket.getInputStream().read(bytes);
        System.out.println("收到服务端发送"+new String(bytes));
        socket.close();
    }
}
